<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="./static/reset.css">
    <link rel="stylesheet" href="./static/reset.css">
    <script src="http://internal.passport.xidibuy.com/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>
    <?php if (!empty($_COOKIE['user_id'])) {
    echo '<script>window.location.href = "http://www.test.com/index.html";</script>';
}?>
    <style>
        body{
            font-size: 13px;
            direction: ltr;
        }
        .content{
            width: 291px;
            margin: 0 auto;
            padding: 30px;
            border: 1px solid #ccc;
        }
        .form-title{
            font-weight: 300;
            font-size: 18px;
            margin-bottom: 25px;
        }
        .control-label{
            margin-top: 2px;
            margin-bottom: 5px;
        }
        .controls{
                height: 54px !important;
        }
        .input-icon{
            border-left: 2px solid #35aa47 !important;
            border-radius: 0 !important;
        }
        .icon-user{
            position: absolute !important;
            z-index: 1;
            margin: 9px 2px 4px 10px;
            width: 16px;
            height: 16px;
        }
        .m-wrap{
            width: 249px;
            height: 20px;
            padding: 6px 6px !important;
            border: 1px solid #e5e5e5;
        }
        .form-actions{
            background-color: #fff;
            border: 0px;
            padding: 0px 30px 25px 30px;
            margin-left: -30px;
            margin-right: -30px;
            margin-top: 20px;
            margin-bottom: 20px;
            border-radius: 0 !important;
        }
        .pull-right{
            padding: 5px 10px;
            margin-top: 1px;
            color: white;
            background-color: #35aa47;
            cursor: pointer;
            outline: none;
            background-image: none;
            filter: none;
            border: 0;
            font-size: 16px;
            float: right;
            display: inline-block;
            border-radius: 5px;
        }
    </style>
    <script>
        jQuery(document).ready(function () {
            jQuery('#submit').click(function (event) {
                event.preventDefault();
                var user = jQuery('input[name="username"]').val();
                var pass = jQuery('input[name="password"]').val();
                $.ajax({
                    type : "post",
                    url :"/user.php",
                    dataType : "json",
                    data :{"user":user,"pass":pass},
                    success : function (data) {
                        if(data.code == 1) {
                            window.location.href = "http://www.test.com/index.php";
                            alert("成功");
                            // jQTip.html('<font color="red">SQL语法检查：' + data.data + '</font>');
                            // $("#sqlform").submit();
                        } else {
                            window.location.href = "http://www.test.com/index.php";
                            alert("成功");
                            // jQTip.html('<font color="red">SQL语法检查：' + data.msg + '</font>');
                        }
                    },
                });
            });
        });
    </script>
</head>
<body class="">
    <div class="logo"></div>
    <div class="content">
        <form class="" method="post" action="">
            <input type="hidden" name="app" value="admin_publish" />
            <input type="hidden" name="mode" value="0" />
            <h3 class="form-title">登录</h3>
            <div class="controls">
                <div class="input-icon left">
                    <i class="icon-user"></i>
                    <input class="m-wrap placeholder-no-fix valid" type="text" placeholder="用户名" name="username">
                </div>
            </div>
            <div class="controls">
                <div class="input-icon left">
                    <i class="icon-user"></i>
                    <input class="m-wrap placeholder-no-fix valid" type="password" placeholder="密码" name="password">
                </div>
            </div>
            <div class="form-actions">
                <button id="submit" type="submit" class="btn green pull-right">
                    登录 <i class="m-icon-swapright m-icon-white"></i>
                </button>
            </div>
        </form>
    </div>
</body>
</html>